package com.linux.huhx.thread3.trylock_1;

/**
 * @Author: huhx
 * @Date: 2017-10-31 上午 9:47
 */
public class Run {
    public static void main(String[] args) {
        MyService myService = new MyService();
        Runnable runnable = () -> {
            System.out.println("name " + Thread.currentThread().getName() + ", time " + System.currentTimeMillis());
            myService.waitMethod();
        };

        Thread threadA = new Thread(runnable);
        threadA.setName("A");
        threadA.start();

        Thread threadB = new Thread(runnable);
        threadB.setName("B");
        threadB.start();
    }
}
